import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', {
  state: () => ({
    count: 0,
    title: 'Hello Pinia'
  }),
  actions: {
    increment() {
      this.count++
    },
    updateTitle(newTitle) {
      this.title = newTitle
    }
  },
  getters: {
    doubleCount: (state) => state.count * 2
  }
})